#!/usr/bin/env bash

# Filename     :	nfs_install.sh
# Last modified:	2022-10-31 12:12
# Version      :
# Author       : jack.zang
# Email        : jack.zang@aishangwei.net
# Description  :
# 使用方法：source <(curl -sL https://gitee.com/jack_zang/kubernetes/raw/master/nfs/nfs_install.sh)
# ******************************************************

yum -y install nfs-utils rpcbind
mkdir /data/nfs -pv && chmod 777 /data/nfs

cat > /etc/exports <<EOF
/data/nfs *(rw,async,insecure,anonuid=1000,anongid=1000,no_root_squash)
EOF

systemctl enable rpcbind nfs-server
systemctl start nfs-server rpcbind

chmod 777 -Rf /data/nfs
exportfs -rv

echo "Client Mount: mount -t nfs 192.168.10.219:/data/nfs /mnt"



